﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="GroupManagement.ascx.cs"
    Inherits="Admin_UserControls_GroupManagement" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<style type="text/css">
    .menuleft_small
    {
        width: 225px;
    }
    .menuleft_lagre
    {
        width: 300px;
    }
    .errorMessage
    {
        color: Red;
    }
    .button
    {
        width: 85px;
    }
</style>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<div>
    <asp:Panel ID="Panel1" runat="server">
        <div class="title">
            <h5>
                QUẢN LÝ NHÓM
            </h5>
        </div>
        <div class="table">
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" GridLines="None"
                AllowPaging="True" OnPreRender="RadGrid1_PreRender" OnItemCommand="RadGrid1_iTemcommand"
                AutoGenerateColumns="False" Skin="Office2007" 
                AllowFilteringByColumn="True">
                <MasterTableView NoMasterRecordsText="Không có kết quả">
                    <Columns>
                        <telerik:GridBoundColumn DataField="group_id" DataType="System.Int32" HeaderText="GroupID"
                            UniqueName="group_id" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridButtonColumn Text="Xem" UniqueName="Xem" CommandName="Xem" ImageUrl="~/Files/images/view.gif"
                            HeaderImageUrl="~/Files/images/view.gif">
                        </telerik:GridButtonColumn>
                        <telerik:GridBoundColumn DataField="username" HeaderText="Người tạo" UniqueName="username">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="group_name" HeaderText="Tên nhóm" UniqueName="group_name">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="created_date" HeaderText="Ngày tạo" UniqueName="created_date"
                            DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy}">
                        </telerik:GridBoundColumn>
                        <telerik:GridButtonColumn Text="Sửa" UniqueName="Sua" CommandName="Sua" ImageUrl="~/Files/images/edit.gif"
                            HeaderImageUrl="~/Files/images/edit.gif">
                        </telerik:GridButtonColumn>
                        <telerik:GridButtonColumn Text="Xóa" UniqueName="Xoa" CommandName="Xoa" ConfirmText="Bạn có chắc chắn muốn xóa?"
                            ImageUrl="~/Files/images/delete.gif" HeaderImageUrl="~/Files/images/delete.gif">
                        </telerik:GridButtonColumn>
                        <telerik:GridButtonColumn Text="Quản lý thành viên" UniqueName="MemberManager" CommandName="MemberManager"
                            ImageUrl="~/Files/images/configure.gif" HeaderImageUrl="~/Files/images/configure.gif">
                        </telerik:GridButtonColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
            </telerik:RadGrid>
        </div>
    </asp:Panel>
</div>
<div>
    <asp:Panel ID="Panel2" runat="server">
        <div class="title">
            <h5>
                Chi tiết nhóm</h5>
        </div>
        <div class="table">
            <table style="width: 100%; margin-top: 25px;">
                <tr>
                    <td style="width: 20%">
                        Người tạo:
                    </td>
                    <td style="width: 80%">
                        <asp:Label ID="Label_UserName" runat="server" CssClass="menuleft_small" Text=""></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        Tên nhóm:
                    </td>
                    <td>
                        <asp:TextBox ID="TextBox_GroupName" runat="server" MaxLength="50" CssClass="menuleft_small"></asp:TextBox>
                        *
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox_GroupName"
                            ErrorMessage="Không được trống" ValidationGroup="GroupManage"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Giới thiệu về nhóm:
                    </td>
                    <td>
                        <asp:TextBox ID="TextBox_About" runat="server" TextMode="MultiLine" Row="5" CssClass="menuleft_small"
                            Rows="5"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Quan tâm đến:
                    </td>
                    <td>
                        <asp:TextBox ID="TextBox_Interest" runat="server" TextMode="MultiLine" Row="5" CssClass="menuleft_small"
                            Rows="5"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Điện thoại nhóm:
                    </td>
                    <td>
                        <asp:TextBox ID="TextBox_Phone" runat="server" MaxLength="15" CssClass="menuleft_small"></asp:TextBox>
                        <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TextBox_Phone"
                            ErrorMessage="Phải là số" Operator="DataTypeCheck" Type="Integer" ValidationGroup="GroupManage"></asp:CompareValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        Trạng thái:
                    </td>
                    <td>
                        <asp:RadioButtonList ID="RadioButtonList1" runat="server" Width="150px">
                            <asp:ListItem Selected="True" Value="0">Đang hoạt động</asp:ListItem>
                            <asp:ListItem Value="1">Ngừng hoạt động</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>
                <tr>
                    <td>
                        Ngày tạo nhóm:
                    </td>
                    <td>
                        <asp:Label ID="Label_CreateDate" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Label ID="Label_Result" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Button ID="Button_OK" runat="server" CssClass="button" Text="Cập nhật" Width="85px"
                            OnClick="Button_OK_Click" ValidationGroup="GroupManage" />
                        <asp:Button ID="Button_Quaylai" runat="server" Text="Quay lại" 
                            CssClass="button" onclick="Button_Quaylai_Click"/>
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>
</div>
<div>
    <asp:Panel ID="Panel3" runat="server">
        <telerik:RadGrid ID="RadGrid2" runat="server" AllowSorting="True" GridLines="None"
            AllowPaging="True" OnPreRender="RadGrid2_PreRender" OnItemCommand="RadGrid2_iTemcommand"
            AutoGenerateColumns="False" Skin="Office2007">
            <MasterTableView NoMasterRecordsText="Không có kết quả">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="member_id" DataType="System.Int32" HeaderText="MemberID"
                        UniqueName="member_id" Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="username" HeaderText="Tên tài khoản" UniqueName="username">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="subscriber" HeaderText="Trạng thái" UniqueName="subscriber">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="created_date" HeaderText="Ngày tham gia" UniqueName="created_date"
                        DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy}">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn Text="Xóa" UniqueName="Xoa" CommandName="Xoa" ConfirmText="Bạn có chắc chắn muốn xóa?"
                        ImageUrl="~/Files/images/delete.gif" HeaderImageUrl="~/Files/images/delete.gif">
                    </telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
        </telerik:RadGrid>
        <br />
        <asp:Button ID="Button_Back" runat="server" Text="Quay lại" 
            onclick="Button_Back_Click" CssClass="button" />
    </asp:Panel>
    
</div>
